<template>
  <view>
    <view
      class="flex-col list-item"
      v-for="item in lists"
      :key="item.id"
      @click="blsClick(item)"
    >
      <view class="flex-row">
        <view class="flex-row items-center flex-1">
          <image class="shrink-0 image_5" :src="item.photo" />
          <view class="flex-col items-start flex-1 ml-15">
            <text class="font_2">{{ item.petName }}</text>
            <view class="mt-16 font_2 text_5 flex-row">
              <custom-tag
                cbackground="#B9EAFF"
                cborder="2rpx solid #00B2FF"
                :text="item.breed"
              ></custom-tag>

              <custom-tag
                cbackground="rgba(255,214,0,0.05)"
                cborder="2rpx solid #FFD600"
                :text="item.color ? '白色' : '黑色'"
              ></custom-tag>
            </view>
            <view
              class="mt-16 font_2 text_5 font-ellipsis"
              style="width: 300rpx"
              >{{ item.address }}</view
            >
          </view>
        </view>
        <view class="ml-20 self-start group_6">
          <text class="font_4">￥</text>
          <text class="font_3">{{ item.price }}</text>
          <text class="font_5">/小时</text>
        </view>
      </view>

      <view class="content-bottom">
        <!-- <view class="bottom-left">
          <span class="number">奔驰GLC260</span>
        </view> -->
        <view class="bottom-left">
          <u-image
            width="26rpx"
            height="32rpx"
            src="/static/index/location2.png"
          ></u-image>
          <span class="number">{{ item.distance }}km</span>
        </view>
        <view class="bottom-right">
          <u-image
            width="30rpx"
            height="32rpx"
            src="/static/index/time-light.png"
          ></u-image>
          <span class="number ml-8">{{ item.time }}</span>
        </view>
      </view>
    </view>
  </view>
</template>

<script>
import customTag from '../../common/custom-tag.vue'
export default {
  components: {
    customTag,
  },
  props: {
    lists: {
      type: Array,
      default: [],
    },
    current: {
      type: String,
      default: '',
    },
  },
  methods: {
    blsClick(item) {
      console.log(this.current, 'itme')
      if (this.current) {
        uni.navigateTo({
          url: `/pages/index/cwbl/blxqDetail/blxqDetail?item=${JSON.stringify(
            item
          )}`,
        })
      } else {
        uni.navigateTo({
          url: `/pages/index/cwbl/blsDetail/blsDetail?item=${JSON.stringify(
            item
          )}`,
        })
      }
      // detailInfo=${JSON.stringify(item)}
    },
  },
}
</script>

<style lang="scss" scoped>
// /deep/ .u-btn--default {
//   color: #ccc !important;
//   border-color: #ffd600 !important;
//   background-color: #fff !important;
// }

.ml-15 {
  margin-left: 30rpx;
}

.mt-5 {
  margin-top: 10rpx;
}

.list-item {
  padding: 24rpx 24rpx 24rpx 32rpx;
  background-color: #ffffff;
  border-radius: 16rpx;
  margin-bottom: 12rpx;
  .image_5 {
    border-radius: 84rpx;
    width: 108rpx;
    height: 108rpx;
  }

  .font_2 {
    font-size: 28rpx;
    font-family: PingFang SC;
    line-height: 26.02rpx;
    font-weight: 700;
    color: #000000;
  }

  .text_5 {
    line-height: 26.32rpx;
  }

  .group_6 {
    margin-top: 4rpx;
    line-height: 28.48rpx;
    height: 30.58rpx;

    .font_4 {
      font-size: 24rpx;
      font-family: D-DIN;
      line-height: 17.72rpx;
      color: #ff7676;
    }

    .font_3 {
      font-size: 40rpx;
      font-family: D-DIN;
      line-height: 28.48rpx;
      color: #ff7676;
    }

    .font_5 {
      font-size: 24rpx;
      font-family: PingFang SC;
      line-height: 22.22rpx;
      font-weight: 700;
      color: #999999;
    }
  }

  .group_7 {
    padding: 0 8rpx;

    .image_6 {
      width: 22rpx;
      height: 26rpx;
    }

    .font_6 {
      font-size: 24rpx;
      font-family: PingFang SC;
      line-height: 17.72rpx;
      color: #999999;
    }

    .text_6 {
      margin-left: 8rpx;
      line-height: 17.8rpx;
    }

    .font_7 {
      font-size: 24rpx;
      font-family: PingFang SC;
      line-height: 22.22rpx;
      color: #999999;
    }

    .text_7 {
      margin-left: 36rpx;
      line-height: 22.12rpx;
      overflow: hidden;
      text-overflow: ellipsis;
      white-space: nowrap;
      flex: 1;
    }
  }
}
.content-bottom {
  display: flex;
  justify-content: space-between;
  padding: 8rpx 0;

  .bottom-right,
  .bottom-left {
    display: flex;
    align-items: center;

    .number {
      font-weight: 500;
      font-size: 12px;
      color: #999999;
      display: block;
    }
  }
}
/deep/.u-btn--default {
  color: #ccc !important;
  border-color: #ffd600 !important;
  background-color: #fff !important;
}
</style>